using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class TRT_ProcedureMap : EntityTypeConfiguration<TRT_Procedure>
    {
        public TRT_ProcedureMap()
        {
            // Primary Key
            this.HasKey(t => t.TRTP_ID);

            // Properties
            this.Property(t => t.TRTP_Name)
                .HasMaxLength(50);

            this.Property(t => t.TRTP_Type)
                .HasMaxLength(10);

            this.Property(t => t.TRTP_Code)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("TRT_Procedure");
            this.Property(t => t.TRTP_ID).HasColumnName("TRTP_ID");
            this.Property(t => t.TRTP_Name).HasColumnName("TRTP_Name");
            this.Property(t => t.TRTP_Type).HasColumnName("TRTP_Type");
            this.Property(t => t.TRTP_Code).HasColumnName("TRTP_Code");
        }
    }
}
